﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GLImp;
using System.Drawing;
using CastleOfTheDisillusioned.Location;

namespace CastleOfTheDisillusioned.Enemies {
	class HammerHammer : Enemy {
		Texture HammerTex = Resources.GetTexture("Images.hammerhammer.png");
		Sprite HammerLeftIdle = new Sprite();
		Sprite HammerLeftWalk = new Sprite();

		public HammerHammer(double X, double Y) {
			this.X = X;
			this.Y = Y;
			this.Width = 3;
			this.Height = 5;

			TouchDamage = true;
			Health = 100;

			//Left Idle
			HammerLeftIdle.Add(HammerTex.Subimage(2, 43, 61, 57));
			HammerLeftIdle.Add(HammerTex.Subimage(65, 43, 61, 57));
			HammerLeftIdle.Add(HammerTex.Subimage(127, 43, 61, 57));
			HammerLeftIdle.Add(HammerTex.Subimage(65, 43, 61, 57));
			HammerLeftIdle.XOffset = -1.5;
			HammerLeftIdle.YOffset = 0.2;
			HammerLeftIdle.PlaybackSpeed = 0.03;

			//Left Walk
			HammerLeftWalk.Add(HammerTex.Subimage(193, 42, 46, 59));
			HammerLeftWalk.Add(HammerTex.Subimage(241, 42, 46, 59));
			HammerLeftWalk.Add(HammerTex.Subimage(288, 42, 46, 59));
			HammerLeftWalk.Add(HammerTex.Subimage(334, 42, 46, 59));
			HammerLeftWalk.Add(HammerTex.Subimage(288, 42, 46, 59));
			HammerLeftWalk.Add(HammerTex.Subimage(241, 42, 46, 59));
			HammerLeftWalk.PlaybackSpeed = 0.1;
			HammerLeftWalk.YOffset = 0.2;
		}

		public override void Draw(){
			//GraphicsManager.DrawRectangle(X, Y, Width, Height, Color.Red);
			//HammerLeftIdle.Draw(X, Y, 5, 5);
			HammerLeftWalk.Draw(X, Y, 4, 5);
		}

		public override void Update() {
			base.Update();

			if (Location_State.CurrentPlayer.X < X) {
				X -= 0.02;
			} else {
				X += 0.02;
			}
		}
	}
}
